import request  from  '@/utils/request.js'

// 获取spu销售属性列表 
export const reqSpuSaleAttrList = (spuId)=>{
    return request({url: `/admin/product/spuSaleAttrList/${spuId}`, method: 'get'})
}


// 保存sku
export const reqAddSku = (skuInfo)=>{
    return request({url: "/admin/product/saveSkuInfo", method: 'post', data: skuInfo})
}

// 获取sku列表数据的接口GET /admin/product/findBySpuId/{spuId}
export const reqSkuListBySpuId = (spuId)=>{
    return request({url: `/admin/product/findBySpuId/${spuId}`, method: 'get'})
}

// 获取sku列表的接口 
export const reqSkuList = (page, limit)=>{
    return request({url: `/admin/product/list/${page}/${limit}`, method: 'get'})
}   
// 上架
export const reqOnSale = (skuId)=>{
    return request({url: `/admin/product/onSale/${skuId}`, method: 'get'})
}
// 下架
export const reqCancelSale = (skuId)=>{
    return request({url: `/admin/product/cancelSale/${skuId}`, method: 'get'})
}
// 获取sku详情的接口
export const reqSkuById = (skuId)=>{
    return request({url: `/admin/product/getSkuById/${skuId}`, method: 'get'})
}
// 删除sku的接口 
export const reqDeleteSkuById = (skuId)=>{
    return request({url: `/admin/product/deleteSku/${skuId}`, method: 'delete'})
}